package tech.aistar.corejava.day15.Synchronizeddemo;

/**
 * 银行账户 临界资源
 * Created by 豆梦寒 on 2019/8/3.
 */
public class Account {
    private double balance = 100;

    public double getMoney(){
        return balance;
    }
    public void withdraw(double money){
        if (money<=balance){
            this.balance -= money;
        }
    }
}
